package sg.edu.nus.iss.vmcs.store;

/*
 * Copyright 2003 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

/**
 *class Coin extends StoreObject
 *This class stores the weight and value of each type of Coin, 
 *and hence enables the machine to recognise each Coin entered.
 * @version 3.0 5/07/2003
 * @author Olivo Miotto, Pang Ping Li
 */

public class Coin extends StoreObject {

    private int value;
    private double weight;
/**
 * Coin()
 *The constructor is an empty constructor
 */
    public Coin () {
    }
/**
 * Coin(int value, double weight)
 * The constructor initializes the attributes 
 * @param value: integer representing the value of the coin in cents 
 * @param weight: double representing the weight of the coin in double
 */
    public Coin (int value, double weight) {
        this.value = value;
        this.weight = weight;
    }
/**
 * void=setValue(int v)
 * This functions sets the value of the coin
 * @param v: integer representing the value of the coin in cents
 */
    public void setValue(int v){
      value = v;
    }
/**
 * void=setWeight(double wt)
 * this function sets the weight of the coin
 * @param wt: double representing the weight of the coin in grams
 */
    public void setWeight(double wt){
      weight = wt;
    }

/**
 * double=getweight()
 * this function returns the weight of the coin
 * @return double: the double value returned is the weight of the coin 
 * in grams 
 */
    public double getWeight () {
        return (weight);
    }
/**
 * int=getValue ()
 * this function returns the value of the coin in cents 
 * @return int: the value returned is an integer representing the valus of the 
 * coin in cents
 */
    public int getValue () {
        return (value);
    }

  }
